import { ref } from 'vue';
import dayjs from 'dayjs';

export function useDateTimeControl() {
  // 日期选择器
  const selectedDate = ref(dayjs('2025-06-13'));
  const selectedTime = ref('10');
  
  // 日期变更处理
  const handleDateChange = (updateAllLayers) => {
    updateAllLayers(selectedDate.value, selectedTime.value);
  };
  
  // 时间变更处理
  const handleTimeChange = (updateAllLayers) => {
    updateAllLayers(selectedDate.value, selectedTime.value);
  };
  
  return {
    selectedDate,
    selectedTime,
    handleDateChange,
    handleTimeChange
  };
} 